@echo off
rem 设置代码页为UTF-8以支持中文
chcp 65001 > nul

echo =====================================================
echo     Setting PIP to use Tsinghua Mirror
echo =====================================================
echo.

rem 检查Python版本
python --version
if %ERRORLEVEL% neq 0 (
    echo Python is not installed or not in PATH. Please install Python first.
    pause
    exit /b 1
)

echo Setting global pip configuration to use Tsinghua mirror...
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
pip config set global.trusted-host pypi.tuna.tsinghua.edu.cn

echo.
echo Configuration completed. PIP will now use Tsinghua mirror by default.
echo =====================================================
echo.
echo You can verify with: pip config list
echo.
pip config list

echo.
echo Press any key to exit...
pause > nul 